package com.meida.boot.handler;

import com.meida.common.enums.AuthStatusEnum;
import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.interceptor.PageInterceptor;
import com.meida.common.mybatis.model.PageParams;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.module.product.client.entity.ProdShop;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 商家列表
 *
 * @author zyf
 */
@Component("shopListHandler")
public class ShopListHandler implements PageInterceptor<ProdShop> {


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        cq.eq(ProdShop.class, "shopState", AuthStatusEnum.AUTHSUCCESS.getCode());
    }

    @Override
    public void complete(CriteriaQuery<ProdShop> cq, List<EntityMap> result, EntityMap extra) {

    }

}
